package com.example.demo.thread.singleton;

/**
 * @Description: 懒汉模式 多线程下需要同步
 * @Author: LLL
 * @Date: 2020-03-19 14:11
 **/
public class LazySingleton {

    private LazySingleton() {
    }

    private static LazySingleton instance = null;

    public static LazySingleton getInstance() {
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
